/** 
 * 2011-10-10 下午05:45:21 
 * UdpChannelPipelineFactory.java 
 * author:sunb 
 */
package com.u6.udp.netty;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;

/**
 * @author sunbin
 * 
 */
public class UdpChannelPipelineFactory implements ChannelPipelineFactory {

	public static final String EncodeHandlerName = "encoder";
	public static final String DecodeHandlerName = "decoder";
	public static final String MessageHandlerName = "handler";

	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline pipeline = Channels.pipeline();
		pipeline.addLast("decoder", new UdpProtocolDecoder());
		pipeline.addLast("encoder", new UdpProtocolEncoder());
		pipeline.addLast("handler", new UdpChannelHandler());
		return pipeline;
	}

}
